#include <iostream>

using std::cout;
using std::endl;

class Point
{
public:
    explicit
    Point(int ix = 0, int iy = 0)
    : _ix(ix)
    , _iy(iy)
    {
        cout << "Point(int = 0, int = 0)" << endl;
    }

    void print() const
    {
        cout << "(" << this->_ix 
             << ", " << this->_iy
             << ")" << endl;
    }

    ~Point()
    {
        cout << "~Point()" << endl;
    }

private:
    int _ix;
    int _iy;
};

void test()
{
    Point pt1(1, 2);//栈对象
    cout << "pt1 = ";
    pt1.print();

    cout << endl;
    //Point = int
    //int = Point(5, 0)//隐式转换
    Point pt2 = 5;//error
    cout << "pt2 = ";
    pt2.print();
}


int main(int argc, char **argv)
{
    test();
    return 0;
}

